<script type="text/javascript">
function ajaxFileUpload(pid) {
	$.ajaxFileUpload({
		url:'index.php?c=zy_mend&m=updateFile&mc_mend_id='+pid,
		secureuri:false,
		fileElementId:'file_name',
		dataType: 'json',
		success: function (data) {
			if(data.code == 1){
				alert('上传成功');
				location=location;
			}else{
				alert('上传失败');
			}
		}
	})
}
</script> 
<h2 class="title">设备维修信息</h2>
<table class="tb_term" width="100%">
<tr>
	<td class="tr_td_width01 alignright">维修单据编号</td>
	<td class="tr_td_width03"><input type=text name="mc_mend_no"  value='{%$mc_mend_no%}' class="txt-normal" size=25  readonly  ></td>
	<td class="tr_td_width02 alignright">经办人员</td>
	<td>
		<select name="admin_user_id" class="select_browse txt-normal"  readonly>
			{%html_options options=$admin_info selected=$admin_user_id%}
		</select>
	</td>
</tr>
<tr>
	<td class="alignright">经办日期</td>
	<td colspan="3">
		<input type=text  class="input_date_browse txt-normal" name="mc_mend_time" id="mc_mend_time"  value='{%$mc_mend_time|date_format:"%Y-%m-%d"%}' readonly>
	</td>	
</tr>
<tr>
	<td class="alignright">维修单据附件</td>
	<td colspan="3">
		<div  class="wrap_accessory">
			<input type="file" name="file_path" id="file_name" size="50" class="input_upload txt-normal"  />
			<input type="button"  class="input_submit txt-normal" value="提交" onclick="ajaxFileUpload({%$mc_mend_id%})"/>
			{%if $file_path%}
			<label class="brower_download"><a href='{%$upload_file_path%}{%format_c c=$smarty.get.c%}{%$file_path%}' target="_blank">下载</a></label>
			{%/if%}
		</div>
	</td>
</tr>
<tr>
	<td class="alignright">维修单据备注</td>
	<td colspan="5"><textarea rows="3" class="textarea_browse txt-normal" name="plan_notes" readonly>{%$mend_info%}</textarea></td>
</tr>
</table>
<p class="btn_right">	
	<button type="button" class="b-default" hidefocus="true" onclick="window.location.href='index.php?c=zy_mend_log&m=add&mc_mend_id={%$smarty.get.mc_mend_id%}'"><span><em>添加设备</em></span></button>
	<button type="button" class="b-default" hidefocus="true" onclick="window.location.href='index.php?c=zy_mend_log&m=imports&obj_id={%$smarty.get.mc_mend_id%}'"><span><em>导入</em></span></button>
	<button type="button" class="b-default" hidefocus="true" onclick="history.go(-1)"><span><em>返回</em></span></button>
</p>

<div class="title_box">
	<div class="title_txt">维修明细</div>
	<div class="find_bar">
		<form name="form_find" method="get" action="">
		<label class="find_name">设备名称</label>
		<input type="text" class="input_find" maxlength="50" name="cn_name" value="{%$smarty.get.cn_name%}">
		<input type="hidden" name="mc_mend_id" value="{%$smarty.get.mc_mend_id%}">
		<input type="hidden" name="m" value="{%$smarty.get.m%}">
		<input type="hidden" name="c" value="{%$smarty.get.c%}">
		<!--<button type="submit" class="b-default" hidefocus="true"><span><em>查询</em></span></button>-->	
		<label class="find_btn" onclick="javascript:form_find.submit();"> 查询</label>
		</form>
	</div>
</div>

<table class="tb_list" width="100%">
<tr class="title">
	<td class="list_td_zw_10">设备自编号</td>
	<td class="list_td_zw_10">设备名称</td>
	<td class="list_td_zw_11">规格型号</td>
	<td class="list_td_zw_08">预计修理费用</td>
	<td>承修单位</td>
	<td class="list_td_zw_opt03">操作</td>
</tr>
{%foreach from=$zy_mend_log_arr item=list%}
<tr>
	<td>{%$list.mc_no%}</td>
	<td class="alignleft" title="{%$list.mc_name%}">{%cut_str str=$list.mc_name sublen=12%}</td>
	<td class="alignleft" title="{%$list.mc_model%}">{%cut_str str=$list.mc_model sublen=15%}</td>
	<td class="alignleft">{%$list.mc_mend_cost%}</td>
	<td class="alignleft" title="$list.mend_comp">{%cut_str str=$list.mend_comp sublen=15%}</td>
	<td>
		<a href='index.php?c=zy_mend_log&m=edit&is_show=1&mend_log_id={%$list.mend_log_id%}'>查看</a>&nbsp;
		<a href='index.php?c=zy_mend_log&m=edit&mend_log_id={%$list.mend_log_id%}&mc_mend_id={%$smarty.get.mc_mend_id%}'>修改</a>&nbsp;
		<a href='index.php?c=zy_mend_log&m=del&mend_log_id={%$list.mend_log_id%}&mc_mend_id={%$smarty.get.mc_mend_id%}' onclick="return confirm('您确认删除吗？')">删除</a>
	</td>
</tr>
{%foreachelse%}
<tr><td colspan="6">暂无内容</td></tr>
{%/foreach%}
</table>
<div class="pagenation aligncenter">
	<div id="pager">{%$page_footer%}</div>
</div>
